package luyihan;

import java.io.Serializable;

//声明Person类的Serializable接口
public class User implements Serializable {
    //显式定义serialVersionUID
    private static final long serialVersionUID = 1L;

    //创建user属性
    int id;
    String username;
    String password;
    String email;
    String phone;

    //构造方法
    public User(int id, String username, String password, String email, String phone) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.email = email;
        this.phone = phone;
    }

    //重写toString方法
    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }
}